<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html{
            height: 100%;
        }
        body{
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            perspective: 1500px;
            perspective-origin: 50% 50%;
            transform-style: preserve-3d;
            background: linear-gradient(180deg,black,gray);
        }
        .cube{
           width: 200px;
           height: 200px;
           /* background-color: lightblue; */
           position: relative;
           transform-style: preserve-3d;
           transform: rotateY(180deg);
           /* transform-origin: 50% 50%; */
           margin: 0 40px;
           transition: all 1s;
           border-radius: 15px;
        }
        .side{
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            border-radius: 15px;
            box-shadow:0px 0px 5px 5px white;
        }
        .left{
           background-image: url(./image/1.png);
           background-size: cover;
            transform: rotateY(-90deg) translateZ(100px);
        }
        .right{
            background-image: url(./image/2.png);
            background-size: cover;
            transform: rotateY(90deg) translateZ(100px);
        }
        .top{
            background-image: url(./image/3.png);
            background-size: cover;
            transform: rotateX(90deg) translateZ(100px);
        }
        .bottom{
            background-image: url(./image/4.png);
            background-size: cover;
            transform: rotateX(90deg) translateZ(-100px);
        }
        .front{
            background-image: url(./image/5.png);
            background-size: cover;
            transform:translateZ(100px);
        }
        .back{
            background-image: url(./image/6.png);
            background-size: cover;
            transform: rotateY(180deg) translateZ(100px);
        }
    </style>
</head>
<body>
    <div class="cube">
        <div class="side left"></div>
        <div class="side right"></div>
        <div class="side top"></div>
        <div class="side bottom"></div>
        <div class="side front"></div>
        <div class="side back"></div>
    </div>
    <div class="cube">
        <div class="side left"></div>
        <div class="side right"></div>
        <div class="side top"></div>
        <div class="side bottom"></div>
        <div class="side front"></div>
        <div class="side back"></div>
    </div>
    <div class="cube">
        <div class="side left"></div>
        <div class="side right"></div>
        <div class="side top"></div>
        <div class="side bottom"></div>
        <div class="side front"></div>
        <div class="side back"></div>
    </div>
    <script>
        document.body.onmousemove = function(event){
            // console.log(event.clientX,event.clientY);
            document.body.style.perspectiveOrigin = 
            event.clientX + "px " + event.clientY + "px";
        }
    </script>
</body>
</html>